import { createServerSideProps } from '@/hooks/useQuery'
import Page from '@/layout/Page'
import http from '@/libs/http'
import { Card, Col, Row } from 'antd'
import type { NextPage } from 'next'
import styled from 'styled-components'
import Link from "next/link"
import Container from '@/component/Container'
const StyledCol = styled(Col)`
  margin-top:10px;
`
const Home: NextPage = (props) => {
  const arr = [
    {
      title: "五子棋",
      href: "/wzq"
    },
    {
      title: "斗地主",
      href: "/ddz"
    }
  ]
  return (
    <Page>
      <Container>
        <Row gutter={20}>
          {
            arr.map(({ title, href }, key) => (
              <StyledCol key={key} span={8} >
                <Link href={"/game/" + href}>
                  <a>
                    <Card title={title}>
                      阔哥牛逼
                    </Card>
                  </a>
                </Link>
              </StyledCol>
            ))
          }
        </Row>
      </Container>
    </Page>
  )
}
export default Home
export const getServerSideProps = createServerSideProps({
  ppk: http.hello()
})